﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ICeFramework.Utilities.VisualStudio;

namespace SharpGen
{
    public partial class OptionsForm : Form
    {
        public OptionsForm()
        {
            InitializeComponent();
        }

        private void OptionsForm_Load(object sender, EventArgs e)
        {
            List<VisualStudioIDEProperties> vs = VisualStudioIDE.GetInstalledVersions();
            cbxVSList.DisplayMember = "Name";
            cbxVSList.DataSource = vs;
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            VisualStudioIDEProperties vs = cbxVSList.SelectedItem as VisualStudioIDEProperties;
            if (vs != null)
            {
                Properties.Settings.Default.VS_IDEPath = vs.EnvironmentPath;
                Properties.Settings.Default.Save();
            }
        }
    }
}
